06. Peek inside $.ajax()
Ud109 AJAX L2 15 L Peek Inside $.Ajax()
We're about to dig into jQuery's source for a second. To do that, you need to:
- open up the project in a browser
- open up DevTools
- switch to the "Sources" pane
- open up the jquery.js file
- in Chrome, you can open a specific file by searching for it with ctrl/command + P
- set a breakpoint on line 9036
Search For A Topic
Now that we've added the breakpoint, if we do a search, then the JavaScript code will run (which will use jQuery's .ajax()
method!) and DevTools will pause when it hits the line with the breakpoint. So go ahead and do a search to cause the code to break at the breakpoint. Why not search for something exciting like "Volcanoes"!
Debugging in Chrome
TIP: If you've never done it before, debugging is a JavaScript application can seem like a complicated process. We'll be looking at the important parts of DevTools in this course, but if you're looking for a deeper dive, check out the following resources on Google's Developer site: